/*
 * Created on 2007-9-3
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.tongji.quickCRUDQ.util;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

import com.tongji.quickCRUDQ.dao.jdbc.ColumnDao;
import com.tongji.quickCRUDQ.dao.jdbc.CommonDao;
import com.tongji.quickCRUDQ.dao.jdbc.TableDao;

/**
 * @author Administrator
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class DaoUtil {
//	  private static ApplicationContext ac=new ClassPathXmlApplicationContext(new String[]{"quickCRUDQ_context.xml","applicationContext-*.xml"});
  private static ApplicationContext ac=new FileSystemXmlApplicationContext(new String[]{"/web-inf/quickCRUDQ_context.xml","/web-inf/applicationContext-hibernate.xml","/web-inf/applicationContext-jdbc.xml","/web-inf/applicationContext-resources.xml","/web-inf/applicationContext-service.xml"});
  private static CommonDao commonDao=(CommonDao)ac.getBean("commonDao");
  private static ColumnDao columnDao=(ColumnDao)ac.getBean("columnDao");
  private static TableDao tableDao=(TableDao)ac.getBean("tableDao");
/**    
 * @return Returns the columnDao.  
 */
public static ColumnDao getColumnDao() { 
	return columnDao; 
}
/**   
 * @return Returns the tableDao.
 */
public static TableDao getTableDao() {
	return tableDao;
}
/**
 * @return Returns the commonDao.
 */
public static CommonDao getCommonDao() {
	return commonDao;
}

public static Object getBean(String beanName){
	return ac.getBean(beanName);
}

}
